#!/bin/bash
script_directory=`dirname $0`

for test_case in `ls -1 $script_directory/cases`; do
    echo "Test case: $test_case"

    cp -r "$script_directory/cases/$test_case/source" "$script_directory/cases/$test_case/actual-result"
    $script_directory/../install/install -d "$script_directory/cases/$test_case/actual-result"

    echo "Comparing files"
    current_directory=$PWD
    cd "$script_directory/cases/$test_case/expected-result"
    for file in `find ! -type d`; do
        diff -aw "../actual-result/$file" "$file"
    done
    cd "$current_directory"

    rm -r "$script_directory/cases/$test_case/actual-result"
    echo
done
